package com.freesun.shop.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.freesun.shop.entity.Basket;
import com.freesun.shop.vo.ShopCartItem;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 购物车 服务类
 * </p>
 *
 * @author zf
 * @since 2019-11-13
 */
public interface BasketService extends IService<Basket> {

    List<ShopCartItem> findByUser(String userId);

    List<ShopCartItem> findByBasketIds(List<Long> asList);

    Integer getProdCountByUser(String userId);

    /**
     * 添加到购物车或者从购物车里删除
     * @param basket
     */
    void changeItem(Basket basket);

    BigDecimal getTotalPay(List<Long> ids);


    /**
     * 清空购物车的条目
     * @param basketIds
     */
    void clearItem(List<Long> basketIds);
}
